﻿
@if (ViewBag.pager.CurrentPage != 1)
{
    <a href="@ViewBag.pager.GenerateUrl(ViewBag.pager.CurrentPage - 1, ViewBag.orderBy,ViewBag.categoryId,ViewBag.titleSearch,ViewBag.textSearch)">Prev</a>
}
@for (int i = 1; i <= ViewBag.pager.PagesCount; i++)
{
    if (i == ViewBag.pager.CurrentPage)
    {
        @i
    }
    else
    {
        <a href="@ViewBag.pager.GenerateUrl(i, ViewBag.orderBy, ViewBag.categoryId, ViewBag.titleSearch, ViewBag.textSearch)">@i</a>
    }
    <span></span>
}

@if (ViewBag.pager.CurrentPage != ViewBag.pager.PagesCount)
{
    <a href="@ViewBag.pager.GenerateUrl(ViewBag.pager.CurrentPage + 1, ViewBag.orderBy,ViewBag.categoryId,ViewBag.titleSearch,ViewBag.textSearch)">Next</a>
}